package com.example.animal;

import java.time.LocalDate;

/**
 * 鱼类，继承自动物类，添加鱼类特有的特征
 */
public class Fish extends Animal {
    protected boolean breathesWithGills; // 是否用鳃呼吸

    /**
     * 构造函数
     * @param name 动物名称
     * @param speciesName 物种名称
     * @param birthDate 出生日期
     * @param color 颜色
     * @param weight 体重
     * @param gender 性别
     * @param temperatureType 体温类型
     * @param breathesWithGills 是否用鳃呼吸
     */
    public Fish(String name, String speciesName, LocalDate birthDate, 
                String color, double weight, Gender gender, TemperatureRegulation temperatureType,
                boolean breathesWithGills) {
        super(name, speciesName, birthDate, color, weight, gender, temperatureType);
        this.breathesWithGills = breathesWithGills;
    }

    @Override
    public void breathe() {
        if (breathesWithGills) {
            System.out.println(name + " " + speciesName + "用鳃呼吸");
        } else {
            System.out.println(name + " " + speciesName + "用肺呼吸");
        }
    }

    @Override
    public void eat() {
        System.out.println(name + " " + speciesName + "进食");
    }
}
